using Documenter
using LidDrivenCavity

# Push the src directory to LOAD_PATH so that Documenter can find the package
push!(LOAD_PATH, "../src/")

# Configure Documenter
makedocs(
    # Package information
    sitename = "LidDrivenCavity.jl Documentation",
    authors = "Lid-Driven Cavity Solver Team",
    
    # Module to document
    modules = [LidDrivenCavity],
    
    # Documentation format and output
    format = Documenter.HTML(
        prettyurls = get(ENV, "CI", "false") == "true",  # Use pretty URLs on CI
        canonical = "https://example.github.io/LidDrivenCavity.jl/stable",
        assets = ["assets/custom.css"],
        sidebar_sitename = false,
        edit_link = "main",
        repolink = "https://github.com/example/LidDrivenCavity.jl"
    ),
    
    # Source directory and build directory
    source = "src",
    build = "build",
    
    # Documentation structure
    pages = [
        "Home" => "index.md",
        "Mathematical Formulation" => "mathematical_formulation.md",
        "API Reference" => "api_reference.md", 
        "Examples" => "examples.md",
        "Performance Guide" => "performance_guide.md"
    ],
    
    # Doctests configuration
    doctest = true,
    linkcheck = false,  # Disable link checking for local builds
    checkdocs = :exports,  # Check that all exported functions are documented
    
    # Strict mode - fail on warnings
    strict = false,  # Set to true for production builds
    
    # Draft mode for faster iteration during development
    draft = false,
    
    # Additional options
    clean = true,
    sitemap = "https://example.github.io/LidDrivenCavity.jl/stable"
)

# Deploy documentation (uncomment for CI/CD)
# deploydocs(
#     repo = "github.com/example/LidDrivenCavity.jl.git",
#     target = "build",
#     branch = "gh-pages",
#     devbranch = "main",
#     versions = ["stable" => "v^", "v#.#", "dev" => "main"]
# )